package com.qianli.cashmama.trade.common.enums;

/**
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2020/3/26
 * Time: 上午10:46
 */
public enum TradeDeductTypeEnum {

    TYPE1("1", "抵扣30%罚息"),
    TYPE2("2", "抵扣50%罚息"),
    TYPE3("3", "抵扣100%罚息"),
    TYPE4("4", "抵扣100%罚息+利息"),
    TYPE5("5", "抵扣100%利息");

    private String type;
    private String desc;

    TradeDeductTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public TradeDeductTypeEnum setType(String type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TradeDeductTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static TradeDeductTypeEnum getEnum(String type) {
        for (TradeDeductTypeEnum enums : TradeDeductTypeEnum.values()) {
            if (enums.getType().equals(type)) {
                return enums;
            }
        }
        return null;
    }
}
